import Vue from 'vue'
import Router from 'vue-router'

// import Msite from '../pages/Msite/Msite'
// import Order from '../pages/Order/Order'
// import Profile from '../pages/Profile/Profile'
// import Search from '../pages/Search/Search'

//路由组件懒加载
const Msite = () => import('../pages/Msite/Msite');
const Order = () => import('../pages/Order/Order');
const Profile = () => import('../pages/Profile/Profile');
const Search = () => import('../pages/Search/Search');


import Login from '../pages/Login/Login'
import Shop from '../pages/Shop/Shop'
import ShopGoods from '../pages/Shop/ShopGoods/ShopGoods'
import ShopRatings from '../pages/Shop/ShopRatings/ShopRatings'
import ShopInfo from '../pages/Shop/ShopInfo/ShopInfo'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/msite'
    },
    {
      path: '/msite',
      name: 'Msite',
      component: Msite,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/order',
      name: 'Order',
      component: Order,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/profile',
      name: 'Profile',
      component: Profile,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/search',
      name: 'Search',
      component: Search,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/shop',
      component: Shop,
      children: [{
        path: '/shop/goods',
        name: 'ShopGoods',
        component: ShopGoods
      },{
        path: '/shop/ratings',
        name: 'ShopRatings',
        component: ShopRatings
      },{
        path: '/shop/info',
        name: 'ShopInfo',
        component: ShopInfo
      },{
        path: '',
        redirect: '/shop/goods'
      }]
    }
  ]
})
